<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
      xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>房屋信息列表</title>
    <link th:replace="common/header"/>
    <link rel="stylesheet" th:href="@{/css/tip.css}"/>
    <script type="text/javascript" th:src="@{/js/androidwheel/androidwheel.js}"></script>
    <script type="text/javascript" th:src="@{/js/layer/tip.js}"></script>
</head>
<body class="no-skin">
<div th:replace="common/top"/>
<div class="main-container ace-save-state" id="main-container">
    <div th:replace="common/menu"/>
    <div class="main-content">
        <div class="main-content-inner">
            <div th:replace="common/title"/>
            <div class="page-content">
                <div th:replace="common/skin"/>
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <h3 class="header smaller lighter blue"><i class="fa fa-list" aria-hidden="true"></i>房屋信息列表</h3>
                        <form id="form" name="form" th:action="@{/houseInfo/getAll}" th:method="post"
                              th:object="${houseInfoForm}">
                            <div class="row-fluid">
                                <!--PAGE CONTENT BEGINS HERE-->
                                <div class="span4">
                                    <a shiro:hasPermission="/houseInfo/import" class="btn btn-info"
                                       th:href="@{/houseInfo/import}"><i class="fa fa-file-archive-o"
                                                                         aria-hidden="true"></i>导入</a>
                                    <a shiro:hasPermission="/houseInfo/export" class="btn btn-info"
                                       th:href="@{/houseInfo/export}"><i class="fa fa-external-link"
                                                                         aria-hidden="true"></i>导出</a>
                                    <a shiro:hasPermission="/houseInfo/add" class="btn btn-info"
                                       th:href="@{/houseInfo/add}"><i class="fa fa-plus"
                                                                      aria-hidden="true"></i>添加</a>
                                    <button shiro:hasPermission="/houseInfo/deleteAll" type="button"
                                            class="btn btn-danger"
                                            th:onclick="'deleteAll(\'/houseInfo/deleteAll\');'"><i
                                            class="fa fa-times" aria-hidden="true"></i>删除
                                    </button>
                                </div>
                                <div class="span2">
                                    <div class="row-fluid">
                                        <div class="span1">
                                            <span class="input_text">省:</span>
                                        </div>
                                        <div class="span11">
                                            <select th:field="*{province}" id="province" name="province"
                                                    class="input_fix"
                                                    th:onchange="'provinceChange(this.value, null, \'全部\')'"
                                                    th:onclick="'provinceChange(this.value, null, \'全部\')'">
                                                <option value="">全部</option>
                                                <option th:each="province : ${provinceList}"
                                                        th:value="${province.provinceCode}"
                                                        th:text="${province.provinceName}">山东
                                                </option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="span2">
                                    <div class="row-fluid">
                                        <div class="span1">
                                            <span class="input_text">市:</span>
                                        </div>
                                        <div class="span11">
                                            <select th:field="*{city}" id="city" name="city" class="input_fix"
                                                    th:onchange="'cityChange(this.value, null, \'全部\')'"
                                                    th:onclick="'cityChange(this.value, null, \'全部\')'">
                                                <option value="">全部</option>
                                                <option th:each="city : ${cityList}"
                                                        th:value="${city.cityCode}" th:text="${city.cityName}">山东
                                                </option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="span2">
                                    <div class="row-fluid">
                                        <div class="span1">
                                            <span class="input_text">区:</span>
                                        </div>
                                        <div class="span11">
                                            <select th:field="*{region}" id="region" name="region"
                                                    class="input_fix">
                                                <option value="">全部</option>
                                                <option th:each="region : ${regionList}"
                                                        th:value="${region.regionCode}"
                                                        th:text="${region.regionName}">山东
                                                </option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="span2">
                                    <button class="btn btn-info" style="float: right;" type="button"
                                            onclick="pagechange(1);"><i class="fa fa-search"
                                                                        aria-hidden="true"></i>查询
                                    </button>
                                </div>
                            </div>
                            <table class="table">
                                <thead>
                                <tr>
                                    <td class="center" style="width:80px;"><label><a href="javascript:void(0);"
                                                                                     th:onclick="'selectAll(this)'">全/不选</a></label>
                                    </td>
                                    <td>房屋名称</td>
                                    <td class="hidden-480">卧室-客厅-厨房-卫生间</td>
                                    <td class="hidden-480">朝向</td>
                                    <td class="hidden-480">房屋面积(平方米)</td>
                                    <td class="hidden-480">所在楼层/总楼层</td>
                                    <td class="hidden-480">所在小区</td>
                                    <td class="hidden-480">省-市-区</td>
                                    <td class="hidden-480">住宅用途</td>
                                    <td class="hidden-480">购买时间</td>
                                    <td class="hidden-480">产权(年)</td>
                                    <td>操作</td>
                                </tr>
                                </thead>
                                <tbody>
                                <tr th:each="house: ${houseInfoList}">
                                    <td class="center"><label><input type="checkbox" name="selectids"
                                                                     th:value="${house.id}"/><span
                                            class="lbl">&nbsp;</span></label></td>
                                    <td th:text="${house.houseName}">doudou</td>
                                    <td class="hidden-480"
                                        th:text="${house.roomNumber} + '间-' + ${house.drawingNumber} + '间-' + ${house.kitchenNumber} + '间-' + ${house.restroomNumber} + '间'">
                                        1-1-1-1
                                    </td>
                                    <td class="hidden-480"
                                        th:text="${house.orientation == null} ? '' : ${house.orientation.text} + '向'">
                                        南
                                    </td>
                                    <td class="hidden-480"
                                        th:text="${house.houseArea ne null ? #numbers.formatDecimal(house.houseArea, 1, 2) + '平方米' : ''}">
                                        89
                                    </td>
                                    <td class="hidden-480"
                                        th:text="${house.layer ne null} ? ${house.layer} + '层/' + ${house.totalLayer} + '层' : ''">
                                        15/32
                                    </td>
                                    <td class="hidden-480" th:text="${house.polt}">海尔家园</td>
                                    <td class="hidden-480"
                                        th:text="${house.provinceName} + '-' + ${house.cityName} + '-' + ${house.regionName}">
                                        山东-青岛-四方
                                    </td>
                                    <td class="hidden-480" th:text="${house.purpose}">商用</td>
                                    <td class="hidden-480"
                                        th:text="${house.buyTime ne null ? #dates.format(house.buyTime, 'yyyy年MM月dd日') : ''}">
                                        2017-09-09
                                    </td>
                                    <td class="hidden-480"
                                        th:text="${house.propertyRight ne null} ? ${house.propertyRight} + '年' : ''">
                                        70
                                    </td>
                                    <td><a shiro:hasPermission="/houseInfo/edit" href="#"
                                           class="btn btn-warning btn-minier"
                                           th:href="@{'/houseInfo/edit?id=' + ${house.id}}" th:text="修改">修改</a>
                                        <a shiro:hasPermission="/houseInfo/delete" href="#"
                                           class="btn btn-danger btn-minier"
                                           th:href="@{'/houseInfo/delete?id=' + ${house.id}}" th:text="删除">删除</a>
                                        <a shiro:hasPermission="/houseInfo/view" href="#"
                                           class="btn btn-primary btn-minier"
                                           th:href="@{'/houseInfo/view?id=' + ${house.id}}" th:text="查看详情">查看详情</a>
                                        <a shiro:hasPermission="/houseImage/upload" href="#"
                                           class="btn btn-primary btn-minier"
                                           th:href="@{'/houseImage/houseInfo/upload?id=' + ${house.id}}"
                                           th:text="上传图片">上传图片</a>
                                        <a shiro:hasPermission="/houseInfo/setLocation" href="#"
                                           class="btn btn-primary btn-minier"
                                           th:href="@{'/houseInfo/setLocation?id=' + ${house.id}}"
                                           th:text="设置位置">设置位置</a>
                                        <a shiro:hasPermission="/houseInfo/setLocation" href="#"
                                           class="btn btn-primary btn-minier"
                                           th:href="@{'/propertyOwnershipCertificate/setOwnerShip?id=' + ${house.id}}"
                                           th:text="房产证">房产证</a>
                                    </td>
                                </tr>
                                </tbody>
                                <tfoot>
                                <tr>
                                    <td colspan="12">
                                        <div class="row-fluid" th:replace="common/page"/>
                                    </td>
                                </tr>
                                </tfoot>
                            </table>
                        </form>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <div th:replace="common/footer"/>
</div><!-- /.main-container -->
<div th:replace="common/buttom"/>
<div th:replace="common/layer"/>
</body>
</html>
